﻿using System.Collections.Generic;
using ZilLion.Service.Core.DapperWrapper;
using ZilLion.Service.TaskPlatform.Domain.Entity;

namespace ZilLion.Service.TaskPlatform.Domain.Respository.Interface
{
    public interface ITaskStateRespository
    {
        /// <summary>
        ///     获取当前serverid所有记录
        /// </summary>
        /// <returns></returns>
        IEnumerable<TaskStateEntity> GetAllTaskState(string nodeid = null);

        /// <summary>
        ///     按ID 或者log
        /// </summary>
        /// <param name="taskid"></param>
        /// <param name="nodeid"></param>
        /// <returns></returns>
        TaskStateEntity GetTaskState(string taskid, string nodeid = null);


        /// <summary>
        ///     修改
        /// </summary>
        /// <param name="logEntity"></param>
        void SaveTaskRunState(TaskStateEntity logEntity,UnitOfWork unit=null);

        /// <summary>
        ///     修改执行次数
        /// </summary>
        /// <param name="logEntity"></param>
        void SaveTaskExcuteCount(TaskStateEntity logEntity, UnitOfWork unit = null);

        /// <summary>
        ///     删除
        /// </summary>
        /// <param name="logEntity"></param>
        void RemoveTaskState(TaskStateEntity logEntity, UnitOfWork unit = null);
    }
}